<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button{
            border-color: skyblue;
            color: skyblue;
            border-radius: 10px;
        }
        .c-gray {
            color: #ccc;
        }
        .c-green {
            color: green;
        }
        .c-red {
            color: red;
        }
    </style>
</head>
<body>
    <h1 style="text-align: center;color: skyblue;">回收列表</h1>
    <div style="text-align: center;">
        <!-- <button id="addBtn"></button> -->
        
    </div>
    <div class="box">
        <table align="center" width="1200px" border="1px" rules="all">
        <tr>
            <td>序号</td>
            <td>作者</td>
            <td>标题</td>
            <td>内容</td>
            <td>分类</td>
            <!-- <td>图片</td> -->
            <td>链接</td>
            <td>状态</td>
            <td>添加时间</td>
            <td>操作</td>
        </tr>
        {{each articles item index}}
        <tr>
            <td>{{index + 1}}</td>
            <td>{{item.author}}</td>
            <td>{{item.article}}</td>
            <td>{{item.content}}</td>
            <td>{{item.cate_name}}</td>
            <!-- <td>{{item.cover}}</td> -->
            <td><a href="#">查看详情</a></td>
            <!-- <td>{{item.content}}</td> -->
            
            <!-- <td>{{item.author}}</td> -->
           
            <td>
                <!-- {{if item.Audit_status  == 0}}
                <span class="c-gray">待审核</span>
                {{else if item.Audit_status == 1}}
                <span class="c-green">审核通过</span>
                {{else}}
                    <span class="c-red">审核失败</span>
                {{/if}} -->
                {{@ item.Audit_status_text}}
            </td>
            <td>{{item.addtime | dateFormat 'YYYY-MM-DD'}}</td>
            <td>
                <!-- <a href="/edit?id={{item.id}}">编辑</a> -->
                <a href="javascript:;"onclick="confirmDelete('{item.id}');">永久删除</a>
                <a href="/restore?id={{item.id}}" onclick="return confirm('确认还原');">还原文章</a>
            </td>
        </tr>
        {{/each}}
    </table>
    </div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.5.1/layer.js"></script>
<script>
    
    document.getElementById('addBtn').onclick = function(){
        location.href = '/add'
    }
    function confirmDelete(id){
        let result = layer.confirm('确认删除吗?确定吗?永久删除数据不可还原',{
            btn:['是的','取消'],
            shadeClose:true,
            shade:[0.3,'#000']

        },()=>{
            location.href="/delete?id="+id
        },()=>{
            layer.msg('已取消')
        });
    }
</script>
</html>